package com.java.business.controller;

import com.java.business.model.Appointment;
import com.java.business.model.PurchaseBill;
import com.java.business.service.AppointmentService;
import com.java.business.service.PurchaseBillService;
import com.java.common.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * 维保预约管理
 */
@RestController
@RequestMapping("/appointment")
public class AppointmentController {

    @Autowired
    private AppointmentService appointmentService;

    @PostMapping("/list")
    public Result list(@RequestBody Appointment appointment) {
        return appointmentService.list(appointment);
    }

    @PostMapping("/save")
    public Result save(@RequestBody Appointment appointment) {
        return appointmentService.save(appointment);
    }

    @PostMapping("/modify")
    public Result modify(@RequestBody Appointment appointment) {
        return appointmentService.modify(appointment);
    }

    @GetMapping("/remove")
    public Result remove(int[] ids) {
        return appointmentService.remove(ids);
    }

    @PostMapping("/sendSm")
    public Result sendSm(@RequestBody String phone, HttpServletRequest req) {
        return appointmentService.sendSm(phone,req);
    }

}
